<template>
    <div class="page">
        <NavHeader @updateHeader="updateHeader" v-show="showHeader"></NavHeader>
        <div class="app-main-content-hide">
            <router-view v-slot="{ Component }">
                <transition>
                    <component :is="Component" />
                </transition>
            </router-view>
        </div>
    </div>
</template>

<script>
import NavHeader from '../common/NavHeader.vue'
import useHeaderStore from '@/store/modules/header'
import {
    emitter
} from "../../utils/eventBus";
export default {
    name: 'Layout',
    data() {

    },
    components: {
        NavHeader
    },
    computed: {
        showHeader() {
            return useHeaderStore().headerShowSatatus;
        }
    },
    methods: {
        updateHeader(v) {
            useHeaderStore().setHeaderShowStatus(v);
        }

    },
    mounted() {
        emitter.on("Showheader", (v) => {
            this.updateHeader(v);
        });
    }
};
</script>

<style lang="scss" scoped>
.app-main-content-hide {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

@font-face {
    font-family: "youshe";
    src: url("@/fonts/YouSheBiaoTiHei-2.ttf");
}

@font-face {
    font-family: "pangmen";
    src: url("@/fonts/pangmenzhengdao.ttf");
}
</style>
